<template>
  <div>
    <el-container>
<!--头部-->
      <el-header style="text-align: right; font-size: 20px">
        <span>{{username}}</span> &nbsp;&nbsp;
        <span>
          <el-button @click="logout" type="warning" size="small">退出</el-button>
        </span>
      </el-header>
<!-- 侧边-->
      <el-container>
        <el-aside width="200px">
          <!--          <el-menu :default-openeds="['1']">-->
          <el-menu>
            <el-submenu index="1">
              <template slot="title"><i class="el-icon-message"></i>学生管理</template>
              <el-menu-item index="1-1">
                <router-link to="/admin/stu" tab="span">
                  学生信息
                </router-link>
              </el-menu-item>
              <el-menu-item index="1-2">宿舍信息</el-menu-item>
            </el-submenu>
            <el-submenu index="2">
              <template slot="title"><i class="el-icon-menu"></i>教室管理</template>

              <el-menu-item index="2-1">教室信息</el-menu-item>
              <el-menu-item index="2-2">排课信息</el-menu-item>


            </el-submenu>
          </el-menu>
        </el-aside>
<!--主体-->
        <el-container>
          <el-main>
                <!--此处需要来回切换其他页面-->
            <router-view></router-view>

          </el-main>
          <el-footer>@ 2025 MEET Copyright</el-footer>
        </el-container>

      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  name: "View2Admin",
  computed:{
    username(){
      return this.$store.state.username
    }
  },
  data() {
    return {}
  },
  methods: {
    logout(){
      this.$router.push('/')
    }
  }
}
</script>

<style scoped>
.el-header {
  background-color: #409EFF; /* Element UI 主色调 */
  color: #fff;
  text-align: center;
  line-height: 60px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.el-aside {
  background-color: #545c64; /* 深灰侧边栏 */
  color: #fff;
  text-align: center;
  line-height: 200px;
  height: 640px;
}

.el-main {
  background-color: #f5f7fa; /* 浅灰背景 */
  color: #606266;
  text-align: center;
  line-height: 160px;
}

.el-footer {
  background-color: #667eea; /* 蓝紫 footer */
  color: #606266;
  text-align: center;
  line-height: 60px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>
